package book;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 张宇田
 * Date: 2024-10-14
 * Time: 18:20
 */
public class BookList {
    public Book[] books = new Book[10];
    private int usedSize;
    boolean isnBored = false;
    public BookList() {
        //book 一个新对象
        /*books[0] = new Book("三国演义","罗贯中",10,"小说",isnBored);
        books[1] = new Book("水浒传","施耐庵",59,"小说",isnBored);
        books[2] = new Book("西游记","吴承恩",20,"小说",isnBored);*/
        books[0] = new Book("三国演义","罗贯中",10,"小说");
        books[1] = new Book("水浒传","施耐庵",59,"小说");
        books[2] = new Book("西游记","吴承恩",20,"小说");
        usedSize = 3;
    }
    public void setSize (int size){
        usedSize = size;
    }
    public int  getSize (){
        return usedSize;
    }
    /**
     * 获取第几本书
     * */
    //本来写这个方法是为了找书的时候打印一下这个
    public Book selectBook(int pos){
        return books[pos+1];
    }
    public void putBook(int pos,Book book){
        this.books[pos] = book;
    }
    /*public String getName(Book book,int pos){
        return books[pos].name;
        //不在一个包里 怎么访问私有变量
    }*/


}
